﻿<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<link rel="Bookmark" href="imgs/favicon.ico"/>
	<link rel="Shortcut Icon" href="imgs/favicon.ico"/>
	<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css"/>
	<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css"/>
	<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css"/>
	<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin"/>
	<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css"/>
	<title>商城</title>
</head>
<body>
<article class="cl pd-20">
	<div class="Hui-article">
		<article class="cl pd-20">
			<div class="cl pd-5 bg-1 bk-gray">
				<span class="r">共有数据：<strong id="pageTotal">0</strong> 条</span>
			</div>
			<div class="mt-10">
				<table class="table table-border table-bordered table-hover table-bg">
					<thead>
					<tr>
						<th scope="col" colspan="6">消费统计</th>
					</tr>
					<tr class="text-c">
						<th>商品名称</th>
						<th>下单规格和数量</th>
						<th>下单时间</th>
						<th>实际支付金额</th>
						<th>支付方式（余额or微信</th>
					</tr>
					</thead>
					<tbody>
					<tr class="text-c">
						<td>-</td>
						<td>-</td>
						<td>-</td>
						<td>-</td>
						<td>-</td>
					</tr>
					</tbody>
				</table>
				<div id="pageHtml"></div>
			</div>
		</article>
	</div>
</article>

<!--自定义弹窗-->
<span id="msgPop"></span>
</body>
</html>


<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.page.js"></script>
<script type="text/javascript" src="js/config.js"></script>
<script type="text/javascript" src="js/view.js"></script>
<script type="text/javascript">
	var pages = {
		start: 1, limit: pageSize, total: 0,
		url: '/admin/uorder.html'
	};
	uid = getParamByUrl('uid');
	pages.start = getParamByUrl('start');
	pages.start = pages.start ? pages.start : 1;
	(function () {
		getList();
	})();
	//获取列表
	function getList(){
		var formData = {
			uid: uid,
			start: pages.start,
			limit: pages.limit,
		};
		$.ajax({
			type: apis.userOrderIndex.method,
			url: apis.userOrderIndex.url,
			data: formData,
			success: function (res) {
				console.log(res);
				if (res.code < 0) {
					msgPop({msg: res.msg}); return
				}
				var d = res.data;
				var h = '', i;
				for (i = 0; i < d.length; i ++) {
					h += '<tr class="text-c">';
					h += '<td>' + d[i].gname + '</td>';
					h += '<td>' + d[i].sku_name + '</td>';
					h += '<td>' + d[i].addtime + '</td>';
					h += '<td>' + d[i].real_pay + '</td>';
					h += '<td>' + d[i].pay_way + '</td>';
					h += '</tr>';
				}
				$('tbody').html(h);
				pages.total = res.total;
				$('#pageTotal').html(res.total);
				pageHtml(pages);
			},
			error: function () {
				console.log('错误啦！');
			}
		});
	}
</script>